package com.sooncode.project.focusservice.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sooncode.project.core.annotations.LookupModel;
import com.sooncode.project.core.generic.BasicAddEvent;
import com.sooncode.project.core.generic.BasicModifyEvent;
import com.sooncode.project.core.model.Entity;
import com.sooncode.project.focusservice._.base.BaseDomainModel;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
@LookupModel
public class CourseSetting extends BaseDomainModel<CourseSetting> {
    private String age;
    private String level;
    private Double minScore;
    private Double maxScore;
    private String testType;//听觉、视觉
    private String type;//听觉基础,视觉基础
    private String content;
    private List<CourseSettingItem> items;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createDate;

    public void modify(){
        causes(BasicModifyEvent.class,this);
    }
    public void copy() {
        this.setId(new Entity().getId());
        this.setCreateDate(new Date());
        causes(BasicAddEvent.class,this);
    }
}
